//
// Description: 575. 分糖果
// Created by Loading on 2021/4/3.
//

#include <bits/stdc++.h>

using namespace std;

int distributeCandies(vector<int> &candyType) {
    unordered_set<int> s;
    for (auto &x : candyType) {
        s.insert(x);
    }

    return min(s.size(), candyType.size() / 2);
}

int main() {
    vector<int> candyType = {1, 1, 2, 3};
    cout << distributeCandies(candyType) << endl;
}